import React, { Fragment, useRef } from "react";

function Box() {
    let inputRef = useRef("HHAH");
    function getvalue() {
        console.log(inputRef.current.value)
    }
    return (
        <Fragment>
            <input ref={inputRef} className="mt-3 form-control" placeholder="请输入" />
            <button onClick={getvalue} className="mt-3 btn btn-primary">当前值</button>
        </Fragment>
    )
}

export default Box